<template>
    <div>
        <div class="register_con">
        <div class="l_con fl">
            <a class="reg_logo"><img src="/static/images/logo.png"></a>
            <div class="reg_slogan">足不出户  ·  新鲜每一天</div>
            <div class="reg_banner"></div>
        </div>

        <div class="r_con fr">
            <div class="reg_title clearfix">
                <h1>用户注册</h1>
                
            </div>
            <div class="reg_form clearfix">
                <form>
                    <ul>
                        <li>
                            <label>用户名:</label>
                            <input type="text" name="user_name" id="user_name" v-model="username">
                            <span class="error_tip">提示信息</span>
                        </li>					
                        <li>
                            <label>密码:</label>
                            <input type="password" name="pwd" id="pwd" v-model="password">
                            <span class="error_tip">提示信息</span>
                        </li>
                        <li>
                            <label>确认密码:</label>
                            <input type="password" name="cpwd" id="cpwd" v-model="password2">
                            <span class="error_tip">提示信息</span>
                        </li>
                        <li>
                            <label>邮箱:</label>
                            <input type="text" name="email" id="email" v-model="email">
                            <span class="error_tip">提示信息</span>
                        </li>
                        <li class="agreement">
                            <input type="checkbox" name="allow" id="allow" checked="checked">
                            <label>同意<a href='#'>《好又多用户使用协议》</a></label>
                            <span class="error_tip2">提示信息</span>
                        </li>
                        <li class="reg_sub">
                            <input type="submit" value="注 册" @click.prevent="adduser">
                        </li>
                    </ul>				
                    </form>
                </div>

            </div>

        </div>

        <div class="footer no-mp">
            <div class="foot_link">
                <a href="#">关于我们</a>
                <span>|</span>
                <a href="#">联系我们</a>
                <span>|</span>
                <a href="#">招聘人才</a>
                <span>|</span>
                <a href="#">友情链接</a>		
            </div>
            <p>CopyRight © 2016 北京趣活信息技术有限公司 All Rights Reserved</p>
            <p>电话：010-51851888    京ICP备*******8号</p>
        </div>
    </div>
</template>

<script>
import axios from 'axios'
export default {
    data() {
        return {
            username:"",
            password:"",
            password2:"",
            email:""
        }
    },
    methods: {
        adduser(){
            let form_data = new FormData()
            form_data.append("username",this.username)
            form_data.append("password",this.password)
            form_data.append("password2",this.password2)
            form_data.append("email",this.email)
            axios({
                url:"http://127.0.0.1:8000/app01/userapi/",
                method:"post",
                data:form_data
            }).then(res=>{
                console.log(res)
            })
        }
    },
    created() {
        
    },
    
}
</script>